package exception;


@SuppressWarnings("serial")
public class DatabaseConnectException extends Exception {

	private String exception;
	private Integer connectionType;

	public static final Integer CONNECT = 0;
	public static final Integer DISCONNECT = 1;

	public DatabaseConnectException(Exception e, Integer connectionType) {
		this.exception = e.toString();
		this.connectionType = connectionType;
	}

	public String toString() {
		if (connectionType == DatabaseConnectException.CONNECT) {
			return "Ocorreu erro ao tentar se conectar com o banco "
					+ exception;
		}
		
		return "Ocorreu erro ao tentar desconectar o banco " + exception;
	}
}
